// JavaScript Document
// perform JavaScript after the document is scriptable.
$(function() {
	// setup ul.tabs to work as tabs for each div directly under div.panes
	$("ul.tabs").tabs("div.panes > div");
	InitSelect1(document.citys_p.province_p,document.citys_p.city_p);
	InitSelect1(document.citys_m.province_m,document.citys_m.city_m);
	InitSelect1(document.citys_w.province_w,document.citys_w.city_w);
	setcitys_w();
	
});
//search china train
function setcitys_t(){
	//InitSelect($('select[@name=train_province]'),document.Chezhans.train_city);
	InitSelect(document.Chezhans.train_province,document.Chezhans.train_city);
	InitSelect(document.ChufaDida.train_province1,document.ChufaDida.train_city1);
	InitSelect(document.ChufaDida.train_province2,document.ChufaDida.train_city2); 
	
	$("#train_province").change(function(){
	OnSelectRegion(document.Chezhans.train_province,document.Chezhans.train_city,document.Chezhans.Chezhan)							   
							   })
	$("#train_city").change(function(){
	document.Chezhans.Chezhan.value=$(this).val();						   
							   })
	$("#train_province1").change(function(){
	OnSelectRegion(document.ChufaDida.train_province1,document.ChufaDida.train_city1,document.ChufaDida.Chufa)							   
							   })	
	$("#train_province2").change(function(){
	OnSelectRegion(document.ChufaDida.train_province2,document.ChufaDida.train_city2,document.ChufaDida.Dida)							   
							   })	
	$("#train_city1").change(function(){
	document.ChufaDida.Chufa.value=$(this).val();						   
							   })
	
	$("#train_city2").change(function(){
	document.ChufaDida.Dida.value=$(this).val();						   
							   })	
	
	$("#chezhans").hide();
	$("#checis").hide();
	$('input[name="searchtype"]').click(function(){
	$('fieldset>form').hide();
	
	$("#"+$(this).val()+"").show();
  })
  }
//search citys
function setcitys_w(){
	//InitSelect($('select[@name=province_w]'),document.citys.city);
	//InitSelect1(document.citys_w.province_w,document.citys_w.city_w);
	//InitSelect1($("#province_w"),document.citys.city);
	$("#province_w").change(function(){
	OnSelectRegion1(document.citys_w.province_w,document.citys_w.city_w,document.citys_w.cityid_w)							   
							   })
	$("#city_w").change(function(){
	document.citys_w.cityid_w.value=$(this).val();						   
							   })	
		   }
		   
function setcitys_m(){
	//InitSelect($('select[@name=province_m]'),document.citys.city);
	//InitSelect1(document.citys_m.province_m,document.citys_m.city_m);
	//InitSelect1($("#province_m"),document.citys.city);
	$("#province_m").change(function(){
	OnSelectRegion1(document.citys_m.province_m,document.citys_m.city_m,document.citys_m.cityid_m)							   
							   })
	$("#city_m").change(function(){
	document.citys_m.cityid_m.value=$(this).val();						   
							   })	
		   }

function setcitys_p(){
	//InitSelect($('select[@name=province_p]'),document.citys.city);
	//InitSelect1(document.citys_p.province_p,document.citys_p.city_p);
	//InitSelect1($("#province_p"),document.citys.city);
	$("#province_p").change(function(){
	OnSelectRegion1(document.citys_p.province_p,document.citys_p.city_p,document.citys_p.cityid_p)							   
							   })
	$("#city_p").change(function(){
	document.citys_p.cityid_p.value=$(this).val();						   
							   })	
		   }	